<?php

namespace App\Models\View;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class RsVUser extends Model
{
    use HasFactory;
    protected $table='rs_v_user';
    public static function lists(){
        $where=[];
        $query=self::where($where);
        $count=$query->count();
        $data = $query->orderBy('id', 'desc')->get()->map(function (RsVUser $rebate) use ($count) {
            $rebate = $rebate->attributesToArray();

            // $rebate['is_show_home'] = $rebate['is_show_home']==0 ?'否' : '是';

            return $rebate;
        })->toArray();
        return $data ? compact('count', 'data') : false;

    }
}
